package com.leigang.swagger.config;

/**
 * @author leigang
 * @description: 动态数据源上下文
 * @date 20/8/12  21:57
 */
public class DynamicDataSourceHolder {
    public static final ThreadLocal<String> DATA_SOURCE_NAME = new ThreadLocal<>();


    public static void set(String name){
        DATA_SOURCE_NAME.set(name);
    }


    public static void clear(){
        DATA_SOURCE_NAME.remove();
    }

    public static String  get(){
        return DATA_SOURCE_NAME.get();
    }

}
